home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: rec.games.hack
- Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!agate!ames!ncar!uchinews!cdsmail!timbuk.cray.com!walter.cray.com!ned.cray.com!atl
- From: atl@cray.com (Anthony Laundrie {x66591 CF/DEV})
- Subject: Easter calculation
- Message-ID: <1994Apr14.101837.9850@ned.cray.com>
- Lines: 26
- Nntp-Posting-Host: tofu.cray.com
- References: <2nb9v7$aqi@dscomsa.desy.de> <1994Mar31.083039.24113@martha.utcc.utk.edu> <2nk8cd$5ju@taco.cc.ncsu.edu>
- Date: 14 Apr 94 10:18:36 CDT
-
-
- #include <stdio.h>
-
- easter(y)
- int y;
- /* prints the month/day for Easter in a given year */
- {
- int a,b,c,d,e,f,g,h,i,k,l,m,n,p;
-
- a = y % 19;
- b = y / 100;
- c = y % 100;
- d = b / 4;
- e = b % 4;
- f = (b + 8) / 25;
- g = (b - f + 1) / 3;
- h = (19*a + b - d - g + 15) % 30;
- i = c / 4;
- k = c % 4;
- l = (32 + 2*e + 2*i - h - k) % 7;
- m = (a + 11*h + 22*l) / 451;
- n = (h + l - 7*m + 114) / 31;
- p = (h + l - 7*m + 114) % 31;
-
- printf("%d/%d\n",n,p+1);
- }
-